<template>
	<view>
		<detaillist :list="list" :islog="islog" :log="log" :tabindex="tabindex"> </detaillist>
	</view>
</template>

<script>
	import detaillist from "@/pages/list/detail_list.vue";
	export default {
		components: {
			detaillist
		},
		data() {
			return {
				totalPage:'',
				page: 1,
				list: [],
				limit:5
			}
		},
		onShow() {
			this.getlist()
		},
		methods: {
			getlist() { //获取首页数据列表
				var that = this;
				let data = {
					data
				}
				let requestParams = {
					limit: this.limit,
					page: this.page
				};
				this.$module.sm(requestParams, 1, res => {
					data.data = res
				})
				this.Htpp.post('/mehrb/nffw/transaction/page', 'app', {
					datalist: data
				}).then(ret => {
					that.$module.sm(ret, 2, res => {
						this.totalPage = res.data.totalPage
						if (that.page == 1) {
							this.list = res.data.list;
						} else {
							if (res.data.list.length > 0) {
								for (var i = 0; i < res.data.list.length; i++) {
									that.list.push(res.data.list[i]);
								}
							}
							if (res.data.list.length < 10) {
								this.log = "没有数据了"
								return
							}
						}

						setTimeout(() => {
							that.isinit = false;
							that.islog = false;
						}, 100)
					})
				})
			},
		},
		onReachBottom() {
			this.jiazai = "加载中...";
			this.page += 1;
			if (this.page > this.totalPage) {
				this.$module.showToast("已经到底了")
				return
			} else {
				this.shop_init()
			}
		},
	}
</script>

<style>

</style>